package com.ycfmedical.bed.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.TextView;

import com.ycfmedical.bed.R;
import com.ycfmedical.bed.local.entity.HisNurseRecordsMsg;

import butterknife.BindView;
import cn.droidlover.xdroidmvp.base.SimpleRecAdapter;
import cn.droidlover.xdroidmvp.kit.KnifeKit;

/**
 * Created by yf on 2017-05-1.
 */

public class HisNursedRecordsAdapter extends SimpleRecAdapter<HisNurseRecordsMsg, HisNursedRecordsAdapter.ViewHolder> {




    public HisNursedRecordsAdapter(Context context) {
        super(context);
    }

    @Override
    public ViewHolder newViewHolder(View itemView) {
        return new ViewHolder(itemView);
    }

    @Override
    public int getLayoutId() {
        return R.layout.adapter_nurse_records_item;
    }

    @Override
    public void onBindViewHolder(ViewHolder holder, int position) {
        HisNurseRecordsMsg hisNurseRecordsMsg = data.get(position);

        holder.bedID.setText("床号："+hisNurseRecordsMsg.getBedId());
        holder.Date.setText(hisNurseRecordsMsg.getNurseRecordsDate());
        holder.nursedContent.setText(hisNurseRecordsMsg.getNurseRecordsDetail());
    }


    public static class ViewHolder extends RecyclerView.ViewHolder {

        @BindView(R.id.bedID)
        TextView bedID;
        @BindView(R.id.Date)
        TextView Date;
        @BindView(R.id.nursedContent)
        TextView nursedContent;

        public ViewHolder(View itemView) {
            super(itemView);
            KnifeKit.bind(this, itemView);
        }
    }
}
